package com.atguigu.jxc.service.impl;
import com.atguigu.jxc.dao.SupplierDao;
import com.atguigu.jxc.entity.Supplier;
import com.atguigu.jxc.service.SupplierService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SupplierServiceImpl implements SupplierService {
    @Autowired
    SupplierDao supplierDao;
    @Override
    public List<Supplier> list(Integer page, Integer rows, String supplierName) {
        List<Supplier>suppliers = supplierDao.list(page,rows,supplierName);
        return suppliers;
    }

    @Override
    public void save(Supplier supplier) {
        if(supplier.getSupplierId()==null){
            supplierDao.save(supplier);
        }else{
            supplierDao.update(supplier);
        }
    }

    @Override
    public void delete(List<String>list ) {
        supplierDao.delete(list);
    }
}
